<?php

class admin extends CI_Controller {
        
	public function index()
	{   
            $this->load->helper('url_helper');
            $this->load->view('administrator/login');
        }
        function viewhomeuser(){
            $this->load->model("m_user_role");
            $uname=$this->input->post('userlogin');
            $upwd=$this->input->post('userpwd');
            $data['resultbyname']=$this->m_user_role->get_user_by_name($uname,$upwd);
            $tf='false';
            if(count($data['resultbyname'])>0){
                $tf='true';
            }  else {
                $data['resultbyemail']=$this->m_user_role->get_user_by_email($uname,$upwd);
                if(count($data['resultbyname'])>0){
                    $tf='true';
                }
            }
             if($tf==TRUE){
                 $data["usergroup"]=$this->m_user_role->get_user_group();
                 $this->load->view("administrator/register",$data);
             }else{
                 
             }
        }
}
?>
